package com.eurabia.eggchat.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.eurabia.eggchat.pojo.SysEggchatFans;
import com.eurabia.eggchat.pojo.form.SysEggchatFansForm;
import com.eurabia.eggchat.pojo.query.SysEggchatFansQuery;
import com.eurabia.eggchat.dao.SysEggchatFansDao;
import com.eurabia.eggchat.service.SysEggchatFansService;

import javax.annotation.Resource;


/**
 * SysEggchatFansService 
 */
@Service
public class SysEggchatFansServiceImpl implements SysEggchatFansService {
    @Resource
    private SysEggchatFansDao sysEggchatFansDao;
	
	/**
     * 查询 SysEggchatFans
     */
    @Override
    public List<SysEggchatFans> find(final SysEggchatFansQuery query) {
        return sysEggchatFansDao.find(query);
    }
    
    /**
     * 分页查询 SysEggchatFans
     */
    @Override
    public Page<SysEggchatFans> findByPage(final SysEggchatFansQuery query) {
        PageHelper.startPage(query.getPage().intValue(), query.getLimit().intValue());
        return (Page<SysEggchatFans>) sysEggchatFansDao.find(query);
    }

    /**
     * 通过id得到一个 SysEggchatFans
     */
    @Override
    public SysEggchatFans get(final String id) {
        return sysEggchatFansDao.get(id);
    }
    
    /**
     * 新增 SysEggchatFans
     */
    @Override
    public void add(final SysEggchatFansForm form) {
        sysEggchatFansDao.add(form);
    }

    /**
     * 修改 SysEggchatFans
     */
    @Override
    public int update(final SysEggchatFansForm form) {
        return sysEggchatFansDao.update(form);
    }
    
    /**
     * 删除一个 SysEggchatFans
     */
    @Override
    public int delete(final String id) {
        return sysEggchatFansDao.delete(id);
    }
	
	/**
     * 修改是否可用
     */
    @Override
    public int changeEnabled(final String id, final Integer enabled) {
        return sysEggchatFansDao.changeEnabled(id, enabled);
    }
}